package cn.bonoon.kernel.web.views;

import org.springframework.web.servlet.ModelAndView;

public class SimpleContent extends ModelAndView{
	
	protected final StringBuilder html;
	protected SimpleContent(){
		super("simple-content");
		addObject("layout", "layout-empty.vm");
		html = new StringBuilder();
		addObject("content", html);
	}
	
	public SimpleContent(Parser parser){
		super("simple-content");
		addObject("layout", "layout-empty.vm");
		html = new StringBuilder();
		addObject("content", html);
		parser.parse(html);
	}
	
	public SimpleContent(StringBuilder html){
		super("simple-content", "content", html);
		addObject("layout", "layout-empty.vm");
		this.html = html;
	}
	
	public static interface Parser{
		StringBuilder parse(StringBuilder html);
	}
}
